package com.zrc.module_find.activity.defrecycleview.demo2

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zrc.module_find.R
import com.zrc.module_find.activity.defrecycleview.DemoResponse

/**
 * @Author: superman
 * @CreateTime: 2022/1/11
 * @Describe:
 */
class Adapter2 : BaseQuickAdapter<DemoResponse.OtherListBean, BaseViewHolder>(R.layout.rv_item_right) {
    override fun convert(holder: BaseViewHolder, item: DemoResponse.OtherListBean) {

        val tv_1= holder.getView<TextView>(R.id.tv_1)
        tv_1.text= "${item.id}"

        val tv_2= holder.getView<TextView>(R.id.tv_2)
        tv_2.text= item.title

        val tv_3= holder.getView<TextView>(R.id.tv_3)
        tv_3.text= item.image

        val tv_4= holder.getView<TextView>(R.id.tv_4)
        tv_4.text= item.tag

        val tv_5= holder.getView<TextView>(R.id.tv_5)
        tv_5.text= item.author_name

        val tv_6= holder.getView<TextView>(R.id.tv_6)
        tv_6.text= item.like_num.toString()

        val tv_7= holder.getView<TextView>(R.id.tv_7)
        tv_7.text= item.create_datetime

        val tv_8= holder.getView<TextView>(R.id.tv_8)
        tv_8.text= item.abstract
        addChildClickViewIds(R.id.ll_item)
    }
}